﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace S.Services.SheepMale.Read.Api
{
    /// <summary>
    /// 全局异常过滤器
    /// </summary>
    public class Exfiter : IExceptionFilter
    {
        private readonly ILogger<Exfiter> _logger;

        public Exfiter(ILogger<Exfiter> logger)
        {
            _logger = logger;
        }
        public void OnException(ExceptionContext context)
        {
            _logger.LogError($"全局过滤器异常，异常信息为:{context.Exception.Message}");
        }
    }
}
